package advertising.handler

import java.sql.DriverManager

//  .--,       .--,
// ( (  \.---./  ) )
//  '.__/o   o\__.'
//     {=  ^  =}
//      >  -  <
//     /       \
//    //       \\
//   //|   .   |\\
//   "'\       /'"_.-~^`'-.
//      \  _  /--'         `
//    ___)( )(___
//   (((__) (__)))    高山仰止, 景行行止; 虽不能至, 心向往之.
//                    High mountains, scenery. Although not to, the heart yearns for it. 
object DBHandler {

  private val driver = "com.mysql.jdbc.Driver"
  private val url = "jdbc:mysql://127.0.0.1:3306/adlbs?ssl=false"
  private val username = "root"
  private val password = "123456"

  {
    Class.forName(driver)
  }

  /**
    * DB Connection
    * @return connection
    */
  def getConnection() = {
    DriverManager.getConnection(url, username, password)
  }

}
